package cn.com.css.taxInspection.gt3.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.com.css.taxInspection.gt3.mapper.JcAjztTjZjjcDlMapper;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjZjjcDlEntity;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjZjjcEntity;
import cn.com.css.taxInspection.gt3.service.JcAjztTjZjjcDlService;
import cn.com.css.taxInspection.util.TsBqUtils;


@Service("jcAjztTjZjjcDlService")
public class JcAjztTjZjjcDlServiceImpl extends ServiceImpl<JcAjztTjZjjcDlMapper, JcAjztTjZjjcDlEntity> implements JcAjztTjZjjcDlService {
	@Override
	@DS("oracle")
	public IPage<JcAjztTjZjjcDlEntity> infoPage(JcAjztTjZjjcEntity jcAjztTjZjjcEntity) {
		Page page = new Page(jcAjztTjZjjcEntity.getPage(), jcAjztTjZjjcEntity.getLimit());
		LambdaQueryWrapper<JcAjztTjZjjcDlEntity> queryWrapper = Wrappers.lambdaQuery();
		
		if(TsBqUtils.isNotNull(jcAjztTjZjjcEntity.getJcry())){
			queryWrapper.like(JcAjztTjZjjcDlEntity::getJcry, jcAjztTjZjjcEntity.getJcry());
		}
		if(TsBqUtils.isNotNull(jcAjztTjZjjcEntity.getNd())){
			queryWrapper.eq(JcAjztTjZjjcDlEntity::getNd, jcAjztTjZjjcEntity.getNd());
		}
		if(TsBqUtils.isNotNull(jcAjztTjZjjcEntity.getSwjgDm())){
			queryWrapper.eq(JcAjztTjZjjcDlEntity::getSwjgDm, jcAjztTjZjjcEntity.getSwjgDm());
		}
		
		IPage<JcAjztTjZjjcDlEntity> iPage = this.page(page, queryWrapper);
		
		return iPage;
	}


}